package com.codingbros.countdown 
{
	import com.codingbros.countdown.model.BasicModel;
	import com.codingbros.countdown.model.IModel;
	import com.codingbros.countdown.view.IView;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import com.codingbros.countdown.view.View;
	import flash.events.Event;
	
	/**
	 * ...
	 * @author peter@codingbros.com
	 */
	public class Countdown extends Sprite {
		private var setDate:Date = new Date(2009, 11, 27, 14, 0, 0, 0);
		private var endDate:Date = new Date(2010, 0, 15, 17, 30, 0, 0);
		
		private var view:IView;
		private var model:IModel;
	
		public function Countdown() {
			trace ("countdown");
			
			model = new BasicModel();
			model.init();
			model.countdownSetDate = this.setDate;
			model.countdownEndDate = this.endDate;
			model.timeRatio;
			
			view = new View();
			this.addChild(MovieClip(view));
			view.init(model);
			
			this.addEventListener(Event.ENTER_FRAME, update);
		}		
		
		private function update(e:Event):void {
			view.update();
		}
	}	
}